/*
 * @author: sanbao
 * @Date: 2022-07-22 20:18:08
 */
import router from "./router";
import { getToken } from "./utils/auth";
router.beforeEach(async (to, from, next) => {
    const hasToken = getToken()
    if (hasToken) {
        next()
    } else {
        if (to.path === "/login") {
            next()
        } else {
            next("/login")
        }
    }
})
